#pragma once

#include <string>
#include <boost\shared_ptr.hpp>
#include <vector>

using namespace boost;

typedef shared_ptr<char> JCharPtr;
typedef shared_ptr<int> JIntPtr;

const int classNameLength = 40;

class JSerialize
{
public:
	JSerialize(void)
	{}
	~JSerialize(void)
	{}
	static JCharPtr SerializeString(std::string data,int& selfLength);
	static JCharPtr SerializeIntArray(int*& intArray,int size,int& selfLength);
	static JCharPtr SerializeVectorInt(std::vector<int>,int& selfLength);
	static JCharPtr SerializeClassHead(std::string className,int classSize,int& selfLength);
	static JCharPtr SerializeInt(int data,int& selfLength);

	static void ReSerializeString(JCharPtr data,std::string& s,int& selfSize);
	static void ReSerializeClassHead(JCharPtr data,std::string& className,int& classSize,int& selfSize);
	static void ReSerializeIntArray(JCharPtr data,std::vector<int>& vecArray,int& selfSize);
};

